<template>
  <view class="panel hot">
    <view class="item" v-for="item in list" :key="item.id">
      <view class="title">
        <text class="title-text">{{ item.title }}</text>
        <text class="title-desc">{{ item.alt }}</text>
      </view>
      <navigator
        :url="`/pages/hot/hot?type=${item.type}`"
        hover-class="none"
        class="cards"
      >
        <image
          :src="src"
          mode="aspectFit"
          class="image"
          v-for="src in item.pictures"
          :key="src"
        />

      </navigator>
    </view>
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import type {HotItem} from '@/types/home'

defineProps<{
  list: HotItem[]
}>()

</script>

<style lang="scss">

.hot {
  margin: 20rpx;
  border-radius: 20rpx;
  display: flex;
  flex-wrap: wrap;
  background-color: #fff;
  min-height: 508rpx;
  overflow: hidden;
  .title {
    display: flex;
    align-items: center;
    justify-content: start;
    padding: 24rpx 24rpx 0;
    font-size: 32rpx;
    color: #262626;
    .title-desc {
      font-size: 24rpx;
      margin-left: 18rpx;
      color: #7f7f7f;
    }
  }

  .item {
    background-color: white;
    width: 50%;
    height: 254rpx;
    border-right: 1rpx solid #eee;
    border-top: 1rpx solid #eee;
    box-sizing: border-box;
    &:nth-child(2n) {
      border-right: 0 none;
    }
    &:nth-child(-n+2) {
      border-top: 0 none;
    }

    .cards {
      padding: 15rpx 20rpx;
    }

    .image {
      width: 150rpx;
      height: 150rpx;

      &:nth-child(2n) {
        padding-left: 13rpx;
      }
    }
  }
}

</style>